<?php
namespace App\Shop\Model\App;
use think\Model;
class AppContent extends Model
{
    const POSITION_BANNER = 1;      //轮播
    const POSITION_NAV = 2;     //导航

    const POSITION_LABEL = [
        self::POSITION_BANNER => '轮播',
        self::POSITION_NAV => '图片导航',
    ];

    public function getPositionLabelAttr($value, $data)
    {
        return self::POSITION_LABEL[$data['position']] ?? "未知";
    }
}